import http from './public'

// 获取用户列表
export const getAllUsers = (params) => {
  return http.fetchGet('/users/all', params)
}

export const getUserByName = (params) => {
  return http.fetchGet('/users/getByName', params)
}

// 新增用户
export const addUser = (params) => {
  return http.fetchPost('/users/add', params)
}

// 获取单个用户
export const getTheUser = (params) => {
  return http.fetchGet('/users/getById', params)
}

// 保存任务
export const addNewTask = (params) => {
  return http.fetchPost('/task/add', params)
}

// 获取待办任务
export const getTask = (params) => {
  return http.fetchGet('/task/getByUserId', params)
}

// 获取任务模板事项
export const getTaskModel = (params) => {
  return http.fetchGet('/task/getTaskModel', params)
}

// 删除待办任务
export const delTask = (params) => {
  return http.fetchGet('/task/delete', params)
}

// 完成/放弃待办任务
export const updateTask = (params) => {
  return http.fetchGet('/task/status', params)
}

// 将任务新增到任务模板中
export const addNewTaskModel = (params) => {
  return http.fetchPost('/task/taskModel/add', params)
}

// 删除任务模板
export const delTaskModel = (params) => {
  return http.fetchGet('/task/taskModel/del', params)
}

// 分发任务
export const handOut = (params) => {
  return http.fetchPost('/task/handOut', params)
}

// 保存任务
export const addNewNote = (params) => {
  return http.fetchPost('/task/note/add', params)
}

// 获取待办任务
export const getNote = (params) => {
  return http.fetchGet('/task/note/getByUserId', params)
}
